<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>附件基本信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/systemStatic/style/admin.css">
    <link rel="stylesheet" href="${ctx}/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/css/public.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
    <style>
        .layui-input-block {
            margin-left: 90px;
        }
        .layui-form-label {
            width: 60px;
            text-align: left;
        }
    </style>
</head>
<body>

<script type="text/html" template>
<form class="layui-form" style="padding: 0px 30px;width: 440px;margin-left: auto;margin-right: auto" lay-filter="sysFileDataForm">

    <div style="margin: 15px 0px;height: 471px;overflow: auto;">
        <div class="layui-form-item">
            <label class="layui-form-label">文件名</label>
            <div class="layui-input-block">
                <input type="text" name="fileName" class="layui-input "  readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">文件路径</label>
            <div class="layui-input-block">
                <input type="text" name="filePath"  class="layui-input " readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">创建时间</label>
            <div class="layui-input-block">
                <input type="text" name="createtime"  class="layui-input dateTimeFiled time-init"  readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">扩展名</label>
            <div class="layui-input-block">
                <input type="text" name="ext"   class="layui-input " readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">说明</label>
            <div class="layui-input-block">
                <input type="text" name="note" class="layui-input " readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">上传者</label>
            <div class="layui-input-block">
                <input type="text" name="creator"  class="layui-input " readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">字节数</label>
            <div class="layui-input-block">
                <input type="text" name="totalBytes"  class="layui-input " readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">下载</label>
            <div class="layui-input-block" style="line-height: 36px">
                <a class="layui-btn layui-btn-sm" id="download">
                    <i class="iconfont iconclouddownload"></i>
                    <span>下载</span>
                </a>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block" style="width: 100%; text-align: center;margin: 0;">
            <button type="reset" id="closeWindow" style="margin-left: 10px;" class="layui-btn btn-n layui-btn-danger btn-save">关闭</button>
        </div>
    </div>
</form>
</script>
<script src="${ctx}/public/component.js" type="text/javascript"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index','layer','commons','setter','form','jquery'], function() {
        var layer = layui.layer,commons=layui.commons,setter=layui.setter,form=layui.form,$=layui.jquery;
        var fileId = '${fileId}';
        $.ajax({
            url: serverPath.systemPath + setter.sysLinkPath + "attachFile/get",
            type: "get",
            contentType: 'application/json',
            dataType: 'json',
            data: {fileId: fileId},
            success: function (data) {
                if (commons._filterRecord(data)) {
                    var returnDate = data.data;
                    form.val('sysFileDataForm', {
                        "fileName": returnDate.fileName,
                        "filePath": returnDate.filePath,
                        "createtime": component.timeData(returnDate.createtime,"1"),
                        "ext": returnDate.ext,
                        "note": returnDate.note,
                        "creator": returnDate.creator,
                        "totalBytes": returnDate.totalBytes
                    });
                } else {
                    window.parent.layer.alert(data.msg);
                }
            }
        });
        $("#download").click(function () {
            window.location.href = serverPath.systemPath + setter.sysLinkPath + "attachFile/download?fileId="+fileId;
        });

        $("#closeWindow").click(function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        })
    })
</script>
</body>
</html>